# include "BCRSmatrix.H"


using namespace std;
using namespace mg::numeric::algebra;


int main(){
  
  BCRSmatrix<int,2,2> bbcsr1 =  {{11,12,13,14,0,0},{0,22,23,0,0,0},{0,0,33,34,35,36},{0,0,0,44,45,0},
                           {0,0,0,0,0,56},{0,0,0,0,0,66}};

  cout << "---------------------------------------------------------------------------------------" << endl;   

  BCRSmatrix<int,2,2> bbcsr2 = {{11,12,0,0,0,0,0,0} ,{0,22,0,0,0,0,0,0} ,{31,32,33,0,0,0,0,0},
                              {41,42,43,44,0,0,0,0}, {0,0,0,0,55,56,0,0},{0,0,0,0,0,66,67,0},{0,0,0,0,0,0,77,78},{0,0,0,0,0,0,87,88}};
      //
  cout << "-------------------------------------------------------------------------------------" << endl;   
  BCRSmatrix<int,2,4> bbcsr3 = {{11,12,0,0,0,0,0,0} ,{0,22,0,0,0,0,0,0} ,{31,32,33,0,0,0,0,0},
                              {41,42,43,44,0,0,0,0}, {0,0,0,0,55,56,0,0},{0,0,0,0,0,66,67,0},{0,0,0,0,0,0,77,78},{0,0,0,0,0,0,87,88}};
  

  cout << "-------------------------------------------------------------------------------------" << endl;  
  bbcsr3.printBlockMatrix();
  cout << "-------------------------------------------------------------------------------------" << endl;    
  bbcsr3.print();
  cout << "------------------------------------------------------------------------------------" << endl;   
  BCRSmatrix<int,2,2> bbcsr4("input17.dat");
  cout << "-------------------------------------------------------------------------------------" << endl;   
  bbcsr4.printBlockMatrix();
  cout << "-----------------------------------------------------------------------------------" << endl;   
  BCRSmatrix<int,2,4> bbcsr5("input18.dat");
  cout << "-----------------------------------------------------------------------------------" << endl;   
  bbcsr5.printBlockMatrix();
  cout << "***" << endl;
  cout << bbcsr5 ;
  cout << "-----------------------------------------------------------------------------------" << endl;   
  BCRSmatrix<int,4,4> bbcsr6("input18.dat");
  cout << "-----------------------------------------------------------------------------------" << endl;   
  bbcsr6.printBlockMatrix();
  cout << "-----------------------------------------------------------------------------------" << endl;   
  bbcsr6.print();
  cout << "-----------------------------------------------------------------------------------" << endl;   
  
  cout << bbcsr4 ; //.print();    
  cout << "-----------------------------------------------------------------------------------" << endl;   
  BCRSmatrix<int,2,4> bbcsr7("input20.dat");
  cout << "-----------------------------------------------------------------------------------" << endl;   
  cout << bbcsr7;   
  cout << "-----------------------------------------------------------------------------------" << endl;   
  bbcsr7.printBlockMatrix();
  cout << "-----------------------------------------------------------------------------------" << endl;   
  
  std::vector<int> v1 = {3,4,0,1,6,8,1,19};
  
  std::vector<int> v01 = {3,4,0,1,6,8,1,19,15,2};

  std::vector<int> v2 = bbcsr4 *v1 ;

  for(auto& x : v2)
     cout << x << ' ' ;
  cout << endl;   
  cout << "-----------------------------------------------------------------------------------" << endl;   

  BCRSmatrix<double,2,2> bbcsr8("input21.dat");
  cout << "-----------------------------------------------------------------------------------" << endl;   

  bbcsr8.print() ;
  cout << "-----------------------------------------------------------------------------------" << endl;   
  bbcsr8.printBlockMatrix();    
  cout << "-----------------------------------------------------------------------------------" << endl;   
  
 //    bbcsr8.findVal(1,4)


  return 0;
}






